<?php defined('RUN_KATANA') or die('Restricted access'); ?>
<?php 
if(is_object($shop->getCurrentProduct()))
{ 
?>
	<div class="shop detail product" itemscope itemtype="http://schema.org/Product">
    	<div class="row-fluid row">
            <div class="span8 col-md-8">
            	<div class="product-info">
					<h1 class="product_title page-title" itemprop="name"><?php echo $shop->CurrentProduct->getTitle(); ?></h1>
					<div class="product-images">
						<div class="product_image detail image">
						<?php require($shop->getViewPath().'elements/Image.php'); ?>
						</div>
					</div>
					<?php if($shop->CurrentProduct->getDescription() != ''):  ?>
					<div class="product-description" itemprop="description"><div class="padding"><?php echo $shop->CurrentProduct->getDescription(); ?></div></div>
					<?php endif; ?>
				</div>
            </div>
            <div class="span4 col-md-4">
            	<div class="product_content_padding product-values product-sidebar">
					<div>
						<a class="btn btn-default btn-block" href="/m/<?php echo $shop->CurrentProduct->getSectionId(); ?>/"><i class="fa fa-chevron-left"></i>  <?php echo ucfirst($txt->getWord('back')).' '.$txt->getWord('to').': '.$shop->CurrentProduct->getSectionTitle(); ?></a>
					</div><div class="clear"></div><hr />
					<div class="details"><?php echo $shop->CurrentProduct->getDetails(); ?></div>
					<?php require($shop->getViewPath().'elements/Variations.php');  ?>
					<?php require($shop->getViewPath().'elements/Price.php');  ?>
					</div>
				</div>
            </div>
        </div><hr />
	</div>
<?php 
	if(is_object($cart))
	{
		if($cart->getDisplayDialog() > 0)
		{
			?>
			<div id="cart-dialog" class="cart-dialog" title="<?php echo ucfirst($txt->getWord('product_added_to_cart')); ?>" style="display:none;">
				<p>
					<span class="ui-icon ui-icon-circle-check" style="float:left; margin:0 7px 50px 0;"></span>
					<?php echo ucfirst($txt->getWord('product_added_to_cart')); ?>. <br />
					<?php echo ucfirst($txt->getWord('continue_shopping')); ?> eller <?php echo $txt->getWord('view_cart'); ?>?
				</p>
			</div>
			<?php
		}
	}
	?>
	<script type="text/javascript">
	jQuery('.varselect').change(function()
	{ jQuery('input.variation').val(jQuery(".varselect").val()); });
	
	jQuery('.varselect').click(function()
	{ jQuery('input.variation').val(jQuery(".varselect").val()); });
	
	function setAttributeValue(att, value)
	{
		if((att > 0) && (value > 0))
		{ jQuery('#attribute_'+att+'_value').val(value); }
	}
	<?php 
	if(count($shop->CurrentProduct->getAttributesVar()) > 0)
	{
		foreach($shop->CurrentProduct->getAttributesVar() as $att)
		{
			?>
			jQuery("select.att_<?php echo $att['id']; ?>_value").change(function()
			{ jQuery("#attribute_<?php echo $att['id']; ?>_value").val(jQuery("select.att_<?php echo $att['id']; ?>_value").val()); });
			<?php 
		}
	}
	?>
	$(function() {
		jQuery("#cart-dialog").dialog({
			resizable: false,
			width: 400,
			modal: false,
			buttons:
			{
				'<?php echo ucfirst($txt->getWord('view_cart')); ?>': function() {
					 document.location.href="/c/15/";
				},
				Cancel: function() {
					$( this ).dialog( "close" );
				}
			}
		});
	});
	</script>
<?php
	if($user->getId() != $shop->CurrentProduct->getUserId())
	{
		$katana->TrackViews['product'][$shop->CurrentProduct->getId()]['table'] = 'product';
		$katana->TrackViews['product'][$shop->CurrentProduct->getId()]['where'] = 'id='.$shop->CurrentProduct->getId();
		$katana->TrackViews['product'][$shop->CurrentProduct->getId()]['set'] = 'views=views+1';
	}
}
?>
